use axum::{Extension, extract::State};
use chat_core::User;
use axum::{response::IntoResponse,Json};

use crate::AppState;




pub(crate) async fn list_chat_users_handler(
    Extension(user): Extension<User>,
    State(state): State<AppState>
) ->Result<impl IntoResponse,crate::error::AppError>{
    let users = state.fetch_chat_users(user.ws_id as _).await?;
    Ok(Json(users))
}